/**
 * 
 */
package com.miolr.core.dao;

import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.DetachedCriteria;

import com.miolr.core.query.PageModel;

/**
 * @author iday
 * 
 */
public interface GenericDao<T> {

	public abstract List<T> queryAll(final PageModel pm, final boolean cached,
			final String cacheRegion);

	public abstract List<T> queryAll(DetachedCriteria detachedCriteria,
			final PageModel pm, final boolean cached, final String cacheRegion);

	public abstract List<T> queryAll(final String sql, final PageModel pm);

	public abstract List<T> queryAll(final String sql, final PageModel pm,
			final boolean cached);

	public abstract List<T> queryAll(final String sql);

	public abstract List<T> queryAll(final String sql, final boolean cached);

	public abstract void deleteAll(Collection<T> c);

	public abstract void delete(T obj);

	public abstract void deleteByPrimaryKey(Serializable key);

	public abstract void saveOrUpdate(Collection<T> c);

	public abstract void merge(T t);

	public abstract void update(T obj);

	public abstract void save(T obj);

	public abstract List<T> findAll();

	public abstract T findByPrimaryKey(Serializable key);

	public abstract void initLazeProperties(Object t, String... nestedNames);

	public abstract Long count(Criteria criteria);

	public abstract T findOne(DetachedCriteria detachedCriteria, boolean cached);

	public abstract Iterator<T> iterate(String sql, Object param);

	public abstract Iterator<T> iterate(String sql);

}
